﻿#region Using directives

using System;
using System.Data;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;

using BesAsm.MasterData.Entities;
using BesAsm.MasterData.Data;

#endregion

namespace BesAsm.MasterData.Data.Bases
{	
	///<summary>
	/// This class is the base class for any <see cref="AsmZoningProviderBase"/> implementation.
	/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
	///</summary>
	public abstract partial class AsmZoningProviderBaseCore : EntityProviderBase<BesAsm.MasterData.Entities.AsmZoning, BesAsm.MasterData.Entities.AsmZoningKey>
	{		
		#region Get from Many To Many Relationship Functions
		#endregion	
		
		#region Delete Methods

		/// <summary>
		/// 	Deletes a row from the DataSource.
		/// </summary>
		/// <param name="transactionManager">A <see cref="TransactionManager"/> object.</param>
		/// <param name="key">The unique identifier of the row to delete.</param>
		/// <returns>Returns true if operation suceeded.</returns>
		public override bool Delete(TransactionManager transactionManager, BesAsm.MasterData.Entities.AsmZoningKey key)
		{
			return Delete(transactionManager, key.AsmZoningId);
		}
		
		/// <summary>
		/// 	Deletes a row from the DataSource.
		/// </summary>
		/// <param name="_asmZoningId">Primary key, zoning ID. Primary Key.</param>
		/// <remarks>Deletes based on primary key(s).</remarks>
		/// <returns>Returns true if operation suceeded.</returns>
		public bool Delete(System.Int32 _asmZoningId)
		{
			return Delete(null, _asmZoningId);
		}
		
		/// <summary>
		/// 	Deletes a row from the DataSource.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_asmZoningId">Primary key, zoning ID. Primary Key.</param>
		/// <remarks>Deletes based on primary key(s).</remarks>
		/// <returns>Returns true if operation suceeded.</returns>
		public abstract bool Delete(TransactionManager transactionManager, System.Int32 _asmZoningId);		
		
		#endregion Delete Methods
		
		#region Get By Foreign Key Functions
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_ASM_ZONING_DETAILED_ZONES_CP key.
		///		FK_ASM_ZONING_DETAILED_ZONES_CP Description: 
		/// </summary>
		/// <param name="_zoneCp">Comprehensive plan conditions zoning code</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.AsmZoning objects.</returns>
		public TList<AsmZoning> GetByZoneCp(System.String _zoneCp)
		{
			int count = -1;
			return GetByZoneCp(_zoneCp, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_ASM_ZONING_DETAILED_ZONES_CP key.
		///		FK_ASM_ZONING_DETAILED_ZONES_CP Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_zoneCp">Comprehensive plan conditions zoning code</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.AsmZoning objects.</returns>
		/// <remarks></remarks>
		public TList<AsmZoning> GetByZoneCp(TransactionManager transactionManager, System.String _zoneCp)
		{
			int count = -1;
			return GetByZoneCp(transactionManager, _zoneCp, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_ASM_ZONING_DETAILED_ZONES_CP key.
		///		FK_ASM_ZONING_DETAILED_ZONES_CP Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_zoneCp">Comprehensive plan conditions zoning code</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.AsmZoning objects.</returns>
		public TList<AsmZoning> GetByZoneCp(TransactionManager transactionManager, System.String _zoneCp, int start, int pageLength)
		{
			int count = -1;
			return GetByZoneCp(transactionManager, _zoneCp, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_ASM_ZONING_DETAILED_ZONES_CP key.
		///		fkAsmZoningDetailedZonesCp Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_zoneCp">Comprehensive plan conditions zoning code</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.AsmZoning objects.</returns>
		public TList<AsmZoning> GetByZoneCp(System.String _zoneCp, int start, int pageLength)
		{
			int count =  -1;
			return GetByZoneCp(null, _zoneCp, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_ASM_ZONING_DETAILED_ZONES_CP key.
		///		fkAsmZoningDetailedZonesCp Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_zoneCp">Comprehensive plan conditions zoning code</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.AsmZoning objects.</returns>
		public TList<AsmZoning> GetByZoneCp(System.String _zoneCp, int start, int pageLength,out int count)
		{
			return GetByZoneCp(null, _zoneCp, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_ASM_ZONING_DETAILED_ZONES_CP key.
		///		FK_ASM_ZONING_DETAILED_ZONES_CP Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_zoneCp">Comprehensive plan conditions zoning code</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.AsmZoning objects.</returns>
		public abstract TList<AsmZoning> GetByZoneCp(TransactionManager transactionManager, System.String _zoneCp, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_ASM_ZONING_DETAILED_ZONES_EX key.
		///		FK_ASM_ZONING_DETAILED_ZONES_EX Description: 
		/// </summary>
		/// <param name="_zoneEx">Existing conditions zoning code</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.AsmZoning objects.</returns>
		public TList<AsmZoning> GetByZoneEx(System.String _zoneEx)
		{
			int count = -1;
			return GetByZoneEx(_zoneEx, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_ASM_ZONING_DETAILED_ZONES_EX key.
		///		FK_ASM_ZONING_DETAILED_ZONES_EX Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_zoneEx">Existing conditions zoning code</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.AsmZoning objects.</returns>
		/// <remarks></remarks>
		public TList<AsmZoning> GetByZoneEx(TransactionManager transactionManager, System.String _zoneEx)
		{
			int count = -1;
			return GetByZoneEx(transactionManager, _zoneEx, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_ASM_ZONING_DETAILED_ZONES_EX key.
		///		FK_ASM_ZONING_DETAILED_ZONES_EX Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_zoneEx">Existing conditions zoning code</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.AsmZoning objects.</returns>
		public TList<AsmZoning> GetByZoneEx(TransactionManager transactionManager, System.String _zoneEx, int start, int pageLength)
		{
			int count = -1;
			return GetByZoneEx(transactionManager, _zoneEx, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_ASM_ZONING_DETAILED_ZONES_EX key.
		///		fkAsmZoningDetailedZonesEx Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_zoneEx">Existing conditions zoning code</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.AsmZoning objects.</returns>
		public TList<AsmZoning> GetByZoneEx(System.String _zoneEx, int start, int pageLength)
		{
			int count =  -1;
			return GetByZoneEx(null, _zoneEx, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_ASM_ZONING_DETAILED_ZONES_EX key.
		///		fkAsmZoningDetailedZonesEx Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_zoneEx">Existing conditions zoning code</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.AsmZoning objects.</returns>
		public TList<AsmZoning> GetByZoneEx(System.String _zoneEx, int start, int pageLength,out int count)
		{
			return GetByZoneEx(null, _zoneEx, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_ASM_ZONING_DETAILED_ZONES_EX key.
		///		FK_ASM_ZONING_DETAILED_ZONES_EX Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_zoneEx">Existing conditions zoning code</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.AsmZoning objects.</returns>
		public abstract TList<AsmZoning> GetByZoneEx(TransactionManager transactionManager, System.String _zoneEx, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_ASM_ZONING_STATUSES key.
		///		FK_ASM_ZONING_STATUSES Description: 
		/// </summary>
		/// <param name="_status">Status of record, in terms of usability for further analysis and general state of data</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.AsmZoning objects.</returns>
		public TList<AsmZoning> GetByStatus(System.String _status)
		{
			int count = -1;
			return GetByStatus(_status, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_ASM_ZONING_STATUSES key.
		///		FK_ASM_ZONING_STATUSES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_status">Status of record, in terms of usability for further analysis and general state of data</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.AsmZoning objects.</returns>
		/// <remarks></remarks>
		public TList<AsmZoning> GetByStatus(TransactionManager transactionManager, System.String _status)
		{
			int count = -1;
			return GetByStatus(transactionManager, _status, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_ASM_ZONING_STATUSES key.
		///		FK_ASM_ZONING_STATUSES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_status">Status of record, in terms of usability for further analysis and general state of data</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.AsmZoning objects.</returns>
		public TList<AsmZoning> GetByStatus(TransactionManager transactionManager, System.String _status, int start, int pageLength)
		{
			int count = -1;
			return GetByStatus(transactionManager, _status, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_ASM_ZONING_STATUSES key.
		///		fkAsmZoningStatuses Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_status">Status of record, in terms of usability for further analysis and general state of data</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.AsmZoning objects.</returns>
		public TList<AsmZoning> GetByStatus(System.String _status, int start, int pageLength)
		{
			int count =  -1;
			return GetByStatus(null, _status, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_ASM_ZONING_STATUSES key.
		///		fkAsmZoningStatuses Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_status">Status of record, in terms of usability for further analysis and general state of data</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.AsmZoning objects.</returns>
		public TList<AsmZoning> GetByStatus(System.String _status, int start, int pageLength,out int count)
		{
			return GetByStatus(null, _status, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_ASM_ZONING_STATUSES key.
		///		FK_ASM_ZONING_STATUSES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_status">Status of record, in terms of usability for further analysis and general state of data</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.AsmZoning objects.</returns>
		public abstract TList<AsmZoning> GetByStatus(TransactionManager transactionManager, System.String _status, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_ASM_ZONING_ZONES_CP key.
		///		FK_ASM_ZONING_ZONES_CP Description: 
		/// </summary>
		/// <param name="_generalZoneCp">Comprehensive plan general zoning code</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.AsmZoning objects.</returns>
		public TList<AsmZoning> GetByGeneralZoneCp(System.String _generalZoneCp)
		{
			int count = -1;
			return GetByGeneralZoneCp(_generalZoneCp, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_ASM_ZONING_ZONES_CP key.
		///		FK_ASM_ZONING_ZONES_CP Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_generalZoneCp">Comprehensive plan general zoning code</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.AsmZoning objects.</returns>
		/// <remarks></remarks>
		public TList<AsmZoning> GetByGeneralZoneCp(TransactionManager transactionManager, System.String _generalZoneCp)
		{
			int count = -1;
			return GetByGeneralZoneCp(transactionManager, _generalZoneCp, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_ASM_ZONING_ZONES_CP key.
		///		FK_ASM_ZONING_ZONES_CP Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_generalZoneCp">Comprehensive plan general zoning code</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.AsmZoning objects.</returns>
		public TList<AsmZoning> GetByGeneralZoneCp(TransactionManager transactionManager, System.String _generalZoneCp, int start, int pageLength)
		{
			int count = -1;
			return GetByGeneralZoneCp(transactionManager, _generalZoneCp, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_ASM_ZONING_ZONES_CP key.
		///		fkAsmZoningZonesCp Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_generalZoneCp">Comprehensive plan general zoning code</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.AsmZoning objects.</returns>
		public TList<AsmZoning> GetByGeneralZoneCp(System.String _generalZoneCp, int start, int pageLength)
		{
			int count =  -1;
			return GetByGeneralZoneCp(null, _generalZoneCp, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_ASM_ZONING_ZONES_CP key.
		///		fkAsmZoningZonesCp Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_generalZoneCp">Comprehensive plan general zoning code</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.AsmZoning objects.</returns>
		public TList<AsmZoning> GetByGeneralZoneCp(System.String _generalZoneCp, int start, int pageLength,out int count)
		{
			return GetByGeneralZoneCp(null, _generalZoneCp, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_ASM_ZONING_ZONES_CP key.
		///		FK_ASM_ZONING_ZONES_CP Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_generalZoneCp">Comprehensive plan general zoning code</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.AsmZoning objects.</returns>
		public abstract TList<AsmZoning> GetByGeneralZoneCp(TransactionManager transactionManager, System.String _generalZoneCp, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_ASM_ZONING_ZONES_EX key.
		///		FK_ASM_ZONING_ZONES_EX Description: 
		/// </summary>
		/// <param name="_generalZoneEx">General zoning code</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.AsmZoning objects.</returns>
		public TList<AsmZoning> GetByGeneralZoneEx(System.String _generalZoneEx)
		{
			int count = -1;
			return GetByGeneralZoneEx(_generalZoneEx, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_ASM_ZONING_ZONES_EX key.
		///		FK_ASM_ZONING_ZONES_EX Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_generalZoneEx">General zoning code</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.AsmZoning objects.</returns>
		/// <remarks></remarks>
		public TList<AsmZoning> GetByGeneralZoneEx(TransactionManager transactionManager, System.String _generalZoneEx)
		{
			int count = -1;
			return GetByGeneralZoneEx(transactionManager, _generalZoneEx, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_ASM_ZONING_ZONES_EX key.
		///		FK_ASM_ZONING_ZONES_EX Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_generalZoneEx">General zoning code</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.AsmZoning objects.</returns>
		public TList<AsmZoning> GetByGeneralZoneEx(TransactionManager transactionManager, System.String _generalZoneEx, int start, int pageLength)
		{
			int count = -1;
			return GetByGeneralZoneEx(transactionManager, _generalZoneEx, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_ASM_ZONING_ZONES_EX key.
		///		fkAsmZoningZonesEx Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_generalZoneEx">General zoning code</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.AsmZoning objects.</returns>
		public TList<AsmZoning> GetByGeneralZoneEx(System.String _generalZoneEx, int start, int pageLength)
		{
			int count =  -1;
			return GetByGeneralZoneEx(null, _generalZoneEx, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_ASM_ZONING_ZONES_EX key.
		///		fkAsmZoningZonesEx Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_generalZoneEx">General zoning code</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.AsmZoning objects.</returns>
		public TList<AsmZoning> GetByGeneralZoneEx(System.String _generalZoneEx, int start, int pageLength,out int count)
		{
			return GetByGeneralZoneEx(null, _generalZoneEx, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_ASM_ZONING_ZONES_EX key.
		///		FK_ASM_ZONING_ZONES_EX Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_generalZoneEx">General zoning code</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.AsmZoning objects.</returns>
		public abstract TList<AsmZoning> GetByGeneralZoneEx(TransactionManager transactionManager, System.String _generalZoneEx, int start, int pageLength, out int count);
		
		#endregion

		#region Get By Index Functions
		
		/// <summary>
		/// 	Gets a row from the DataSource based on its primary key.
		/// </summary>
		/// <param name="transactionManager">A <see cref="TransactionManager"/> object.</param>
		/// <param name="key">The unique identifier of the row to retrieve.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <returns>Returns an instance of the Entity class.</returns>
		public override BesAsm.MasterData.Entities.AsmZoning Get(TransactionManager transactionManager, BesAsm.MasterData.Entities.AsmZoningKey key, int start, int pageLength)
		{
			return GetByAsmZoningId(transactionManager, key.AsmZoningId, start, pageLength);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the primary key PK_ASM_ZONING index.
		/// </summary>
		/// <param name="_asmZoningId">Primary key, zoning ID</param>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.AsmZoning"/> class.</returns>
		public BesAsm.MasterData.Entities.AsmZoning GetByAsmZoningId(System.Int32 _asmZoningId)
		{
			int count = -1;
			return GetByAsmZoningId(null,_asmZoningId, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_ASM_ZONING index.
		/// </summary>
		/// <param name="_asmZoningId">Primary key, zoning ID</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.AsmZoning"/> class.</returns>
		public BesAsm.MasterData.Entities.AsmZoning GetByAsmZoningId(System.Int32 _asmZoningId, int start, int pageLength)
		{
			int count = -1;
			return GetByAsmZoningId(null, _asmZoningId, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_ASM_ZONING index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_asmZoningId">Primary key, zoning ID</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.AsmZoning"/> class.</returns>
		public BesAsm.MasterData.Entities.AsmZoning GetByAsmZoningId(TransactionManager transactionManager, System.Int32 _asmZoningId)
		{
			int count = -1;
			return GetByAsmZoningId(transactionManager, _asmZoningId, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_ASM_ZONING index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_asmZoningId">Primary key, zoning ID</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.AsmZoning"/> class.</returns>
		public BesAsm.MasterData.Entities.AsmZoning GetByAsmZoningId(TransactionManager transactionManager, System.Int32 _asmZoningId, int start, int pageLength)
		{
			int count = -1;
			return GetByAsmZoningId(transactionManager, _asmZoningId, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_ASM_ZONING index.
		/// </summary>
		/// <param name="_asmZoningId">Primary key, zoning ID</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.AsmZoning"/> class.</returns>
		public BesAsm.MasterData.Entities.AsmZoning GetByAsmZoningId(System.Int32 _asmZoningId, int start, int pageLength, out int count)
		{
			return GetByAsmZoningId(null, _asmZoningId, start, pageLength, out count);
		}
		
				
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_ASM_ZONING index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_asmZoningId">Primary key, zoning ID</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.AsmZoning"/> class.</returns>
		public abstract BesAsm.MasterData.Entities.AsmZoning GetByAsmZoningId(TransactionManager transactionManager, System.Int32 _asmZoningId, int start, int pageLength, out int count);
						
		/// <summary>
		/// 	Gets rows from the datasource based on the primary key R146_ROWID_SDE_UK index.
		/// </summary>
		/// <param name="_objectid"></param>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.AsmZoning"/> class.</returns>
		public BesAsm.MasterData.Entities.AsmZoning GetByObjectid(System.Int32 _objectid)
		{
			int count = -1;
			return GetByObjectid(null,_objectid, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the R146_ROWID_SDE_UK index.
		/// </summary>
		/// <param name="_objectid"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.AsmZoning"/> class.</returns>
		public BesAsm.MasterData.Entities.AsmZoning GetByObjectid(System.Int32 _objectid, int start, int pageLength)
		{
			int count = -1;
			return GetByObjectid(null, _objectid, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the R146_ROWID_SDE_UK index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_objectid"></param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.AsmZoning"/> class.</returns>
		public BesAsm.MasterData.Entities.AsmZoning GetByObjectid(TransactionManager transactionManager, System.Int32 _objectid)
		{
			int count = -1;
			return GetByObjectid(transactionManager, _objectid, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the R146_ROWID_SDE_UK index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_objectid"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.AsmZoning"/> class.</returns>
		public BesAsm.MasterData.Entities.AsmZoning GetByObjectid(TransactionManager transactionManager, System.Int32 _objectid, int start, int pageLength)
		{
			int count = -1;
			return GetByObjectid(transactionManager, _objectid, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the R146_ROWID_SDE_UK index.
		/// </summary>
		/// <param name="_objectid"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.AsmZoning"/> class.</returns>
		public BesAsm.MasterData.Entities.AsmZoning GetByObjectid(System.Int32 _objectid, int start, int pageLength, out int count)
		{
			return GetByObjectid(null, _objectid, start, pageLength, out count);
		}
		
				
		/// <summary>
		/// 	Gets rows from the datasource based on the R146_ROWID_SDE_UK index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_objectid"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.AsmZoning"/> class.</returns>
		public abstract BesAsm.MasterData.Entities.AsmZoning GetByObjectid(TransactionManager transactionManager, System.Int32 _objectid, int start, int pageLength, out int count);
						
		#endregion "Get By Index Functions"
	
		#region Custom Methods
		
		
		#endregion

		#region Helper Functions	
		
		/// <summary>
		/// Fill a TList&lt;AsmZoning&gt; From a DataReader.
		/// </summary>
		/// <param name="reader">Datareader</param>
		/// <param name="rows">The collection to fill</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">number of rows.</param>
		/// <returns>a <see cref="TList&lt;AsmZoning&gt;"/></returns>
		public static TList<AsmZoning> Fill(IDataReader reader, TList<AsmZoning> rows, int start, int pageLength)
		{
			NetTiersProvider currentProvider = DataRepository.Provider;
            bool useEntityFactory = currentProvider.UseEntityFactory;
            bool enableEntityTracking = currentProvider.EnableEntityTracking;
            LoadPolicy currentLoadPolicy = currentProvider.CurrentLoadPolicy;
			Type entityCreationFactoryType = currentProvider.EntityCreationalFactoryType;
			
			// advance to the starting row
			for (int i = 0; i < start; i++)
			{
				if (!reader.Read())
				return rows; // not enough rows, just return
			}
			for (int i = 0; i < pageLength; i++)
			{
				if (!reader.Read())
					break; // we are done
					
				string key = null;
				
				BesAsm.MasterData.Entities.AsmZoning c = null;
				if (useEntityFactory)
				{
					key = new System.Text.StringBuilder("AsmZoning")
					.Append("|").Append((System.Int32)reader[((int)AsmZoningColumn.AsmZoningId - 1)]).ToString();
					c = EntityManager.LocateOrCreate<AsmZoning>(
					key.ToString(), // EntityTrackingKey
					"AsmZoning",  //Creational Type
					entityCreationFactoryType,  //Factory used to create entity
					enableEntityTracking); // Track this entity?
				}
				else
				{
					c = new BesAsm.MasterData.Entities.AsmZoning();
				}
				
				if (!enableEntityTracking ||
					c.EntityState == EntityState.Added ||
					(enableEntityTracking &&
					
						(
							(currentLoadPolicy == LoadPolicy.PreserveChanges && c.EntityState == EntityState.Unchanged) ||
							(currentLoadPolicy == LoadPolicy.DiscardChanges && c.EntityState != EntityState.Unchanged)
						)
					))
				{
					c.SuppressEntityEvents = true;
					c.Objectid = (System.Int32)reader[((int)AsmZoningColumn.Objectid - 1)];
					c.ZoneArea = (reader.IsDBNull(((int)AsmZoningColumn.ZoneArea - 1)))?null:(System.Decimal?)reader[((int)AsmZoningColumn.ZoneArea - 1)];
					c.AsmZoningId = (System.Int32)reader[((int)AsmZoningColumn.AsmZoningId - 1)];
					c.OriginalAsmZoningId = c.AsmZoningId;
					c.City = (reader.IsDBNull(((int)AsmZoningColumn.City - 1)))?null:(System.String)reader[((int)AsmZoningColumn.City - 1)];
					c.Perimeter = (reader.IsDBNull(((int)AsmZoningColumn.Perimeter - 1)))?null:(System.Decimal?)reader[((int)AsmZoningColumn.Perimeter - 1)];
					c.CpId = (reader.IsDBNull(((int)AsmZoningColumn.CpId - 1)))?null:(System.Int32?)reader[((int)AsmZoningColumn.CpId - 1)];
					c.TmpZone = (reader.IsDBNull(((int)AsmZoningColumn.TmpZone - 1)))?null:(System.String)reader[((int)AsmZoningColumn.TmpZone - 1)];
					c.Overlay = (reader.IsDBNull(((int)AsmZoningColumn.Overlay - 1)))?null:(System.String)reader[((int)AsmZoningColumn.Overlay - 1)];
					c.CpOverlay = (reader.IsDBNull(((int)AsmZoningColumn.CpOverlay - 1)))?null:(System.String)reader[((int)AsmZoningColumn.CpOverlay - 1)];
					c.PlanningDistrict = (reader.IsDBNull(((int)AsmZoningColumn.PlanningDistrict - 1)))?null:(System.String)reader[((int)AsmZoningColumn.PlanningDistrict - 1)];
					c.Hist = (reader.IsDBNull(((int)AsmZoningColumn.Hist - 1)))?null:(System.String)reader[((int)AsmZoningColumn.Hist - 1)];
					c.Consv = (reader.IsDBNull(((int)AsmZoningColumn.Consv - 1)))?null:(System.String)reader[((int)AsmZoningColumn.Consv - 1)];
					c.Nrmp = (reader.IsDBNull(((int)AsmZoningColumn.Nrmp - 1)))?null:(System.String)reader[((int)AsmZoningColumn.Nrmp - 1)];
					c.Update = (reader.IsDBNull(((int)AsmZoningColumn.Update - 1)))?null:(System.DateTime?)reader[((int)AsmZoningColumn.Update - 1)];
					c.IsUnincorporated = (reader.IsDBNull(((int)AsmZoningColumn.IsUnincorporated - 1)))?null:(System.Int32?)reader[((int)AsmZoningColumn.IsUnincorporated - 1)];
					c.ZoningId = (reader.IsDBNull(((int)AsmZoningColumn.ZoningId - 1)))?null:(System.Int32?)reader[((int)AsmZoningColumn.ZoningId - 1)];
					c.CpZoningId = (reader.IsDBNull(((int)AsmZoningColumn.CpZoningId - 1)))?null:(System.Int32?)reader[((int)AsmZoningColumn.CpZoningId - 1)];
					c.ZoneEx = (reader.IsDBNull(((int)AsmZoningColumn.ZoneEx - 1)))?null:(System.String)reader[((int)AsmZoningColumn.ZoneEx - 1)];
					c.ZoneCp = (reader.IsDBNull(((int)AsmZoningColumn.ZoneCp - 1)))?null:(System.String)reader[((int)AsmZoningColumn.ZoneCp - 1)];
					c.OriginalZoneEx = (reader.IsDBNull(((int)AsmZoningColumn.OriginalZoneEx - 1)))?null:(System.String)reader[((int)AsmZoningColumn.OriginalZoneEx - 1)];
					c.OriginalZoneCp = (reader.IsDBNull(((int)AsmZoningColumn.OriginalZoneCp - 1)))?null:(System.String)reader[((int)AsmZoningColumn.OriginalZoneCp - 1)];
					c.GeneralZoneEx = (reader.IsDBNull(((int)AsmZoningColumn.GeneralZoneEx - 1)))?null:(System.String)reader[((int)AsmZoningColumn.GeneralZoneEx - 1)];
					c.GeneralZoneCp = (reader.IsDBNull(((int)AsmZoningColumn.GeneralZoneCp - 1)))?null:(System.String)reader[((int)AsmZoningColumn.GeneralZoneCp - 1)];
					c.EditedBy = (System.String)reader[((int)AsmZoningColumn.EditedBy - 1)];
					c.EditReason = (System.String)reader[((int)AsmZoningColumn.EditReason - 1)];
					c.Status = (System.String)reader[((int)AsmZoningColumn.Status - 1)];
					c.AppendDate = (System.DateTime)reader[((int)AsmZoningColumn.AppendDate - 1)];
					c.EditDate = (reader.IsDBNull(((int)AsmZoningColumn.EditDate - 1)))?null:(System.DateTime?)reader[((int)AsmZoningColumn.EditDate - 1)];
					c.Shape = (reader.IsDBNull(((int)AsmZoningColumn.Shape - 1)))?null:(System.Object)reader[((int)AsmZoningColumn.Shape - 1)];
					c.EntityTrackingKey = key;
					c.AcceptChanges();
					c.SuppressEntityEvents = false;
				}
				rows.Add(c);
			}
		return rows;
		}		
		/// <summary>
		/// Refreshes the <see cref="BesAsm.MasterData.Entities.AsmZoning"/> object from the <see cref="IDataReader"/>.
		/// </summary>
		/// <param name="reader">The <see cref="IDataReader"/> to read from.</param>
		/// <param name="entity">The <see cref="BesAsm.MasterData.Entities.AsmZoning"/> object to refresh.</param>
		public static void RefreshEntity(IDataReader reader, BesAsm.MasterData.Entities.AsmZoning entity)
		{
			if (!reader.Read()) return;
			
			entity.Objectid = (System.Int32)reader[((int)AsmZoningColumn.Objectid - 1)];
			entity.ZoneArea = (reader.IsDBNull(((int)AsmZoningColumn.ZoneArea - 1)))?null:(System.Decimal?)reader[((int)AsmZoningColumn.ZoneArea - 1)];
			entity.AsmZoningId = (System.Int32)reader[((int)AsmZoningColumn.AsmZoningId - 1)];
			entity.OriginalAsmZoningId = (System.Int32)reader["asm_zoning_id"];
			entity.City = (reader.IsDBNull(((int)AsmZoningColumn.City - 1)))?null:(System.String)reader[((int)AsmZoningColumn.City - 1)];
			entity.Perimeter = (reader.IsDBNull(((int)AsmZoningColumn.Perimeter - 1)))?null:(System.Decimal?)reader[((int)AsmZoningColumn.Perimeter - 1)];
			entity.CpId = (reader.IsDBNull(((int)AsmZoningColumn.CpId - 1)))?null:(System.Int32?)reader[((int)AsmZoningColumn.CpId - 1)];
			entity.TmpZone = (reader.IsDBNull(((int)AsmZoningColumn.TmpZone - 1)))?null:(System.String)reader[((int)AsmZoningColumn.TmpZone - 1)];
			entity.Overlay = (reader.IsDBNull(((int)AsmZoningColumn.Overlay - 1)))?null:(System.String)reader[((int)AsmZoningColumn.Overlay - 1)];
			entity.CpOverlay = (reader.IsDBNull(((int)AsmZoningColumn.CpOverlay - 1)))?null:(System.String)reader[((int)AsmZoningColumn.CpOverlay - 1)];
			entity.PlanningDistrict = (reader.IsDBNull(((int)AsmZoningColumn.PlanningDistrict - 1)))?null:(System.String)reader[((int)AsmZoningColumn.PlanningDistrict - 1)];
			entity.Hist = (reader.IsDBNull(((int)AsmZoningColumn.Hist - 1)))?null:(System.String)reader[((int)AsmZoningColumn.Hist - 1)];
			entity.Consv = (reader.IsDBNull(((int)AsmZoningColumn.Consv - 1)))?null:(System.String)reader[((int)AsmZoningColumn.Consv - 1)];
			entity.Nrmp = (reader.IsDBNull(((int)AsmZoningColumn.Nrmp - 1)))?null:(System.String)reader[((int)AsmZoningColumn.Nrmp - 1)];
			entity.Update = (reader.IsDBNull(((int)AsmZoningColumn.Update - 1)))?null:(System.DateTime?)reader[((int)AsmZoningColumn.Update - 1)];
			entity.IsUnincorporated = (reader.IsDBNull(((int)AsmZoningColumn.IsUnincorporated - 1)))?null:(System.Int32?)reader[((int)AsmZoningColumn.IsUnincorporated - 1)];
			entity.ZoningId = (reader.IsDBNull(((int)AsmZoningColumn.ZoningId - 1)))?null:(System.Int32?)reader[((int)AsmZoningColumn.ZoningId - 1)];
			entity.CpZoningId = (reader.IsDBNull(((int)AsmZoningColumn.CpZoningId - 1)))?null:(System.Int32?)reader[((int)AsmZoningColumn.CpZoningId - 1)];
			entity.ZoneEx = (reader.IsDBNull(((int)AsmZoningColumn.ZoneEx - 1)))?null:(System.String)reader[((int)AsmZoningColumn.ZoneEx - 1)];
			entity.ZoneCp = (reader.IsDBNull(((int)AsmZoningColumn.ZoneCp - 1)))?null:(System.String)reader[((int)AsmZoningColumn.ZoneCp - 1)];
			entity.OriginalZoneEx = (reader.IsDBNull(((int)AsmZoningColumn.OriginalZoneEx - 1)))?null:(System.String)reader[((int)AsmZoningColumn.OriginalZoneEx - 1)];
			entity.OriginalZoneCp = (reader.IsDBNull(((int)AsmZoningColumn.OriginalZoneCp - 1)))?null:(System.String)reader[((int)AsmZoningColumn.OriginalZoneCp - 1)];
			entity.GeneralZoneEx = (reader.IsDBNull(((int)AsmZoningColumn.GeneralZoneEx - 1)))?null:(System.String)reader[((int)AsmZoningColumn.GeneralZoneEx - 1)];
			entity.GeneralZoneCp = (reader.IsDBNull(((int)AsmZoningColumn.GeneralZoneCp - 1)))?null:(System.String)reader[((int)AsmZoningColumn.GeneralZoneCp - 1)];
			entity.EditedBy = (System.String)reader[((int)AsmZoningColumn.EditedBy - 1)];
			entity.EditReason = (System.String)reader[((int)AsmZoningColumn.EditReason - 1)];
			entity.Status = (System.String)reader[((int)AsmZoningColumn.Status - 1)];
			entity.AppendDate = (System.DateTime)reader[((int)AsmZoningColumn.AppendDate - 1)];
			entity.EditDate = (reader.IsDBNull(((int)AsmZoningColumn.EditDate - 1)))?null:(System.DateTime?)reader[((int)AsmZoningColumn.EditDate - 1)];
			entity.Shape = (reader.IsDBNull(((int)AsmZoningColumn.Shape - 1)))?null:(System.Object)reader[((int)AsmZoningColumn.Shape - 1)];
			entity.AcceptChanges();
		}
		
		/// <summary>
		/// Refreshes the <see cref="BesAsm.MasterData.Entities.AsmZoning"/> object from the <see cref="DataSet"/>.
		/// </summary>
		/// <param name="dataSet">The <see cref="DataSet"/> to read from.</param>
		/// <param name="entity">The <see cref="BesAsm.MasterData.Entities.AsmZoning"/> object.</param>
		public static void RefreshEntity(DataSet dataSet, BesAsm.MasterData.Entities.AsmZoning entity)
		{
			DataRow dataRow = dataSet.Tables[0].Rows[0];
			
			entity.Objectid = (System.Int32)dataRow["OBJECTID"];
			entity.ZoneArea = Convert.IsDBNull(dataRow["zone_area"]) ? null : (System.Decimal?)dataRow["zone_area"];
			entity.AsmZoningId = (System.Int32)dataRow["asm_zoning_id"];
			entity.OriginalAsmZoningId = (System.Int32)dataRow["asm_zoning_id"];
			entity.City = Convert.IsDBNull(dataRow["city"]) ? null : (System.String)dataRow["city"];
			entity.Perimeter = Convert.IsDBNull(dataRow["perimeter"]) ? null : (System.Decimal?)dataRow["perimeter"];
			entity.CpId = Convert.IsDBNull(dataRow["cp_id"]) ? null : (System.Int32?)dataRow["cp_id"];
			entity.TmpZone = Convert.IsDBNull(dataRow["tmp_zone"]) ? null : (System.String)dataRow["tmp_zone"];
			entity.Overlay = Convert.IsDBNull(dataRow["overlay"]) ? null : (System.String)dataRow["overlay"];
			entity.CpOverlay = Convert.IsDBNull(dataRow["cp_overlay"]) ? null : (System.String)dataRow["cp_overlay"];
			entity.PlanningDistrict = Convert.IsDBNull(dataRow["planning_district"]) ? null : (System.String)dataRow["planning_district"];
			entity.Hist = Convert.IsDBNull(dataRow["hist"]) ? null : (System.String)dataRow["hist"];
			entity.Consv = Convert.IsDBNull(dataRow["consv"]) ? null : (System.String)dataRow["consv"];
			entity.Nrmp = Convert.IsDBNull(dataRow["nrmp"]) ? null : (System.String)dataRow["nrmp"];
			entity.Update = Convert.IsDBNull(dataRow["update_"]) ? null : (System.DateTime?)dataRow["update_"];
			entity.IsUnincorporated = Convert.IsDBNull(dataRow["is_unincorporated"]) ? null : (System.Int32?)dataRow["is_unincorporated"];
			entity.ZoningId = Convert.IsDBNull(dataRow["zoning_id"]) ? null : (System.Int32?)dataRow["zoning_id"];
			entity.CpZoningId = Convert.IsDBNull(dataRow["cp_zoning_id"]) ? null : (System.Int32?)dataRow["cp_zoning_id"];
			entity.ZoneEx = Convert.IsDBNull(dataRow["zone_ex"]) ? null : (System.String)dataRow["zone_ex"];
			entity.ZoneCp = Convert.IsDBNull(dataRow["zone_cp"]) ? null : (System.String)dataRow["zone_cp"];
			entity.OriginalZoneEx = Convert.IsDBNull(dataRow["original_zone_ex"]) ? null : (System.String)dataRow["original_zone_ex"];
			entity.OriginalZoneCp = Convert.IsDBNull(dataRow["original_zone_cp"]) ? null : (System.String)dataRow["original_zone_cp"];
			entity.GeneralZoneEx = Convert.IsDBNull(dataRow["general_zone_ex"]) ? null : (System.String)dataRow["general_zone_ex"];
			entity.GeneralZoneCp = Convert.IsDBNull(dataRow["general_zone_cp"]) ? null : (System.String)dataRow["general_zone_cp"];
			entity.EditedBy = (System.String)dataRow["edited_by"];
			entity.EditReason = (System.String)dataRow["edit_reason"];
			entity.Status = (System.String)dataRow["status"];
			entity.AppendDate = (System.DateTime)dataRow["append_date"];
			entity.EditDate = Convert.IsDBNull(dataRow["edit_date"]) ? null : (System.DateTime?)dataRow["edit_date"];
			entity.Shape = Convert.IsDBNull(dataRow["SHAPE"]) ? null : (System.Object)dataRow["SHAPE"];
			entity.AcceptChanges();
		}
		#endregion 
		
		#region DeepLoad Methods
		/// <summary>
		/// Deep Loads the <see cref="IEntity"/> object with criteria based of the child 
		/// property collections only N Levels Deep based on the <see cref="DeepLoadType"/>.
		/// </summary>
		/// <remarks>
		/// Use this method with caution as it is possible to DeepLoad with Recursion and traverse an entire object graph.
		/// </remarks>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="entity">The <see cref="BesAsm.MasterData.Entities.AsmZoning"/> object to load.</param>
		/// <param name="deep">Boolean. A flag that indicates whether to recursively save all Property Collection that are descendants of this instance. If True, saves the complete object graph below this object. If False, saves this object only. </param>
		/// <param name="deepLoadType">DeepLoadType Enumeration to Include/Exclude object property collections from Load.</param>
		/// <param name="childTypes">BesAsm.MasterData.Entities.AsmZoning Property Collection Type Array To Include or Exclude from Load</param>
		/// <param name="innerList">A collection of child types for easy access.</param>
	    /// <exception cref="ArgumentNullException">entity or childTypes is null.</exception>
	    /// <exception cref="ArgumentException">deepLoadType has invalid value.</exception>
		public override void DeepLoad(TransactionManager transactionManager, BesAsm.MasterData.Entities.AsmZoning entity, bool deep, DeepLoadType deepLoadType, System.Type[] childTypes, DeepSession innerList)
		{
			if(entity == null)
				return;

			#region ZoneCpSource	
			if (CanDeepLoad(entity, "DetailedZone|ZoneCpSource", deepLoadType, innerList) 
				&& entity.ZoneCpSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = (entity.ZoneCp ?? string.Empty);
				DetailedZone tmpEntity = EntityManager.LocateEntity<DetailedZone>(EntityLocator.ConstructKeyFromPkItems(typeof(DetailedZone), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.ZoneCpSource = tmpEntity;
				else
					entity.ZoneCpSource = DataRepository.DetailedZoneProvider.GetByDetailedZoneId(transactionManager, (entity.ZoneCp ?? string.Empty));		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'ZoneCpSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.ZoneCpSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.DetailedZoneProvider.DeepLoad(transactionManager, entity.ZoneCpSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion ZoneCpSource

			#region ZoneExSource	
			if (CanDeepLoad(entity, "DetailedZone|ZoneExSource", deepLoadType, innerList) 
				&& entity.ZoneExSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = (entity.ZoneEx ?? string.Empty);
				DetailedZone tmpEntity = EntityManager.LocateEntity<DetailedZone>(EntityLocator.ConstructKeyFromPkItems(typeof(DetailedZone), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.ZoneExSource = tmpEntity;
				else
					entity.ZoneExSource = DataRepository.DetailedZoneProvider.GetByDetailedZoneId(transactionManager, (entity.ZoneEx ?? string.Empty));		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'ZoneExSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.ZoneExSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.DetailedZoneProvider.DeepLoad(transactionManager, entity.ZoneExSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion ZoneExSource

			#region StatusSource	
			if (CanDeepLoad(entity, "Status|StatusSource", deepLoadType, innerList) 
				&& entity.StatusSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = entity.Status;
				Status tmpEntity = EntityManager.LocateEntity<Status>(EntityLocator.ConstructKeyFromPkItems(typeof(Status), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.StatusSource = tmpEntity;
				else
					entity.StatusSource = DataRepository.StatusProvider.GetByStatusId(transactionManager, entity.Status);		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'StatusSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.StatusSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.StatusProvider.DeepLoad(transactionManager, entity.StatusSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion StatusSource

			#region GeneralZoneCpSource	
			if (CanDeepLoad(entity, "Zone|GeneralZoneCpSource", deepLoadType, innerList) 
				&& entity.GeneralZoneCpSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = (entity.GeneralZoneCp ?? string.Empty);
				Zone tmpEntity = EntityManager.LocateEntity<Zone>(EntityLocator.ConstructKeyFromPkItems(typeof(Zone), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.GeneralZoneCpSource = tmpEntity;
				else
					entity.GeneralZoneCpSource = DataRepository.ZoneProvider.GetByZoneId(transactionManager, (entity.GeneralZoneCp ?? string.Empty));		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'GeneralZoneCpSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.GeneralZoneCpSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.ZoneProvider.DeepLoad(transactionManager, entity.GeneralZoneCpSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion GeneralZoneCpSource

			#region GeneralZoneExSource	
			if (CanDeepLoad(entity, "Zone|GeneralZoneExSource", deepLoadType, innerList) 
				&& entity.GeneralZoneExSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = (entity.GeneralZoneEx ?? string.Empty);
				Zone tmpEntity = EntityManager.LocateEntity<Zone>(EntityLocator.ConstructKeyFromPkItems(typeof(Zone), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.GeneralZoneExSource = tmpEntity;
				else
					entity.GeneralZoneExSource = DataRepository.ZoneProvider.GetByZoneId(transactionManager, (entity.GeneralZoneEx ?? string.Empty));		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'GeneralZoneExSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.GeneralZoneExSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.ZoneProvider.DeepLoad(transactionManager, entity.GeneralZoneExSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion GeneralZoneExSource
			
			//used to hold DeepLoad method delegates and fire after all the local children have been loaded.
			Dictionary<string, KeyValuePair<Delegate, object>> deepHandles = new Dictionary<string, KeyValuePair<Delegate, object>>();
			
			//Fire all DeepLoad Items
			foreach(KeyValuePair<Delegate, object> pair in deepHandles.Values)
		    {
                pair.Key.DynamicInvoke((object[])pair.Value);
		    }
			deepHandles = null;
		}
		
		#endregion 
		
		#region DeepSave Methods

		/// <summary>
		/// Deep Save the entire object graph of the BesAsm.MasterData.Entities.AsmZoning object with criteria based of the child 
		/// Type property array and DeepSaveType.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="entity">BesAsm.MasterData.Entities.AsmZoning instance</param>
		/// <param name="deepSaveType">DeepSaveType Enumeration to Include/Exclude object property collections from Save.</param>
		/// <param name="childTypes">BesAsm.MasterData.Entities.AsmZoning Property Collection Type Array To Include or Exclude from Save</param>
		/// <param name="innerList">A Hashtable of child types for easy access.</param>
		public override bool DeepSave(TransactionManager transactionManager, BesAsm.MasterData.Entities.AsmZoning entity, DeepSaveType deepSaveType, System.Type[] childTypes, DeepSession innerList)
		{	
			if (entity == null)
				return false;
							
			#region Composite Parent Properties
			//Save Source Composite Properties, however, don't call deep save on them.  
			//So they only get saved a single level deep.
			
			#region ZoneCpSource
			if (CanDeepSave(entity, "DetailedZone|ZoneCpSource", deepSaveType, innerList) 
				&& entity.ZoneCpSource != null)
			{
				DataRepository.DetailedZoneProvider.Save(transactionManager, entity.ZoneCpSource);
				entity.ZoneCp = entity.ZoneCpSource.DetailedZoneId;
			}
			#endregion 
			
			#region ZoneExSource
			if (CanDeepSave(entity, "DetailedZone|ZoneExSource", deepSaveType, innerList) 
				&& entity.ZoneExSource != null)
			{
				DataRepository.DetailedZoneProvider.Save(transactionManager, entity.ZoneExSource);
				entity.ZoneEx = entity.ZoneExSource.DetailedZoneId;
			}
			#endregion 
			
			#region StatusSource
			if (CanDeepSave(entity, "Status|StatusSource", deepSaveType, innerList) 
				&& entity.StatusSource != null)
			{
				DataRepository.StatusProvider.Save(transactionManager, entity.StatusSource);
				entity.Status = entity.StatusSource.StatusId;
			}
			#endregion 
			
			#region GeneralZoneCpSource
			if (CanDeepSave(entity, "Zone|GeneralZoneCpSource", deepSaveType, innerList) 
				&& entity.GeneralZoneCpSource != null)
			{
				DataRepository.ZoneProvider.Save(transactionManager, entity.GeneralZoneCpSource);
				entity.GeneralZoneCp = entity.GeneralZoneCpSource.ZoneId;
			}
			#endregion 
			
			#region GeneralZoneExSource
			if (CanDeepSave(entity, "Zone|GeneralZoneExSource", deepSaveType, innerList) 
				&& entity.GeneralZoneExSource != null)
			{
				DataRepository.ZoneProvider.Save(transactionManager, entity.GeneralZoneExSource);
				entity.GeneralZoneEx = entity.GeneralZoneExSource.ZoneId;
			}
			#endregion 
			#endregion Composite Parent Properties

			// Save Root Entity through Provider
			if (!entity.IsDeleted)
				this.Save(transactionManager, entity);
			
			//used to hold DeepSave method delegates and fire after all the local children have been saved.
			Dictionary<string, KeyValuePair<Delegate, object>> deepHandles = new Dictionary<string, KeyValuePair<Delegate, object>>();
			//Fire all DeepSave Items
			foreach(KeyValuePair<Delegate, object> pair in deepHandles.Values)
		    {
                pair.Key.DynamicInvoke((object[])pair.Value);
		    }
			
			// Save Root Entity through Provider, if not already saved in delete mode
			if (entity.IsDeleted)
				this.Save(transactionManager, entity);
				

			deepHandles = null;
						
			return true;
		}
		#endregion
	} // end class
	
	#region AsmZoningChildEntityTypes
	
	///<summary>
	/// Enumeration used to expose the different child entity types 
	/// for child properties in <c>BesAsm.MasterData.Entities.AsmZoning</c>
	///</summary>
	public enum AsmZoningChildEntityTypes
	{
		
		///<summary>
		/// Composite Property for <c>DetailedZone</c> at ZoneCpSource
		///</summary>
		[ChildEntityType(typeof(DetailedZone))]
		DetailedZone,
			
		///<summary>
		/// Composite Property for <c>Status</c> at StatusSource
		///</summary>
		[ChildEntityType(typeof(Status))]
		Status,
			
		///<summary>
		/// Composite Property for <c>Zone</c> at GeneralZoneCpSource
		///</summary>
		[ChildEntityType(typeof(Zone))]
		Zone,
		}
	
	#endregion AsmZoningChildEntityTypes
	
	#region AsmZoningFilterBuilder
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="SqlFilterBuilder&lt;AsmZoningColumn&gt;"/> class
	/// that is used exclusively with a <see cref="AsmZoning"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class AsmZoningFilterBuilder : SqlFilterBuilder<AsmZoningColumn>
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the AsmZoningFilterBuilder class.
		/// </summary>
		public AsmZoningFilterBuilder() : base() { }

		/// <summary>
		/// Initializes a new instance of the AsmZoningFilterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public AsmZoningFilterBuilder(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the AsmZoningFilterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public AsmZoningFilterBuilder(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion AsmZoningFilterBuilder
	
	#region AsmZoningParameterBuilder
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="ParameterizedSqlFilterBuilder&lt;AsmZoningColumn&gt;"/> class
	/// that is used exclusively with a <see cref="AsmZoning"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class AsmZoningParameterBuilder : ParameterizedSqlFilterBuilder<AsmZoningColumn>
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the AsmZoningParameterBuilder class.
		/// </summary>
		public AsmZoningParameterBuilder() : base() { }

		/// <summary>
		/// Initializes a new instance of the AsmZoningParameterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public AsmZoningParameterBuilder(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the AsmZoningParameterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public AsmZoningParameterBuilder(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion AsmZoningParameterBuilder
	
	#region AsmZoningSortBuilder
    
    /// <summary>
    /// A strongly-typed instance of the <see cref="SqlSortBuilder&lt;AsmZoningColumn&gt;"/> class
	/// that is used exclusively with a <see cref="AsmZoning"/> object.
    /// </summary>
    [CLSCompliant(true)]
    public class AsmZoningSortBuilder : SqlSortBuilder<AsmZoningColumn>
    {
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the AsmZoningSqlSortBuilder class.
		/// </summary>
		public AsmZoningSortBuilder() : base() { }

		#endregion Constructors

    }    
    #endregion AsmZoningSortBuilder
	
} // end namespace
